package com.romanowski;

import java.util.Date;

public class Collection {

	/**
	 * lastModified - Member that holds the date the last time the collection was updated
   * name - name of the collection, will be saved as <name>.<extension>
   * collection - handle to the File object
	 */
	private Date lastModified;
	private String name;
  private File collection;
  private static String extension = ".txt";  
   
   /**
   * Creates a new collection with an untitled name and empty contents
   */
  Collection(){
 
  }
  /**
  * Opens the collection if it exists, otherwise it is created
  */
  Collection(String name){
    
  }
	
	public Date getLastModified() {
		return lastModified;
	}
	public void setLastModified(Date lastModified) {
		this.lastModified = lastModified;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
   
     /**
     * Creates a collection on the disk
     * @return returns true if the file was successfully created, false if it already existed
     */
     public static boolean create(String name){
       File f = new File(name + extension);
        if(!f.exists()){
          f.createNewFile();
          System.out.println("New file " + name + ".txt has been created
          return true;
        }
        
        return false;
     }
     
     /**
     * Closes the collection without saving the file
     */
     public void close(){
     
     }
     
     /**
     * Closes the collection without saving the file
     */
     public void closeAndSave(){
     
     }
     
     /**
     * Deletes the collection
     */     
     public void delete(){
     
     }
     
     /**
     * Opens a file for editing, will create one if flag is true and the file does not exist
     * @return a File object to the file
     */
     public static File open(String name, boolean shouldCreate){
     
     }
     
     /**
     * Saves the changes to disk
     */
     public void save(){
     
     }
	
}
